The present invention relates to data storage, and more particularly, to providing dynamic buffer size switching for burst errors encountered while reading a magnetic tape.
When an error burst (a burst of errors that occurs within a predetermined distance on a magnetic tape) is encountered while reading data from the magnetic tape, there are several different methods of attempting to handle the error burst. One method is “Reconstructive Error Recovery Procedure (ERP) Using Reserved Buffer,” which is described in more detail in U.S. patent application Ser. No. 13/676,477, filed Nov. 14, 2012, which is herein incorporated by reference. This method uses a reconstructive ERP to reduce backhitches during error burst scenarios, and is referred to herein as C/P ERP Single.
Another such method is referred to as an “Iterative Cut and Paste Error Recovery Procedure” (C/P ERP Multi), which is described in more detail in U.S. patent application Ser. No. 13/676,493, filed Nov. 14, 2012, which is herein incorporated by reference. This method attempts to solve burst reading errors for a tape drive reading a magnetic tape. However, the C/P ERP Multi uses a dedicated buffer area of a predetermined size, which is allocated regardless of other performance concerns (such as whether the tape drive has detected an error burst or not). Therefore, this usage of the dedicated buffer causes performance degradation for normal reading.
C/P ERP Multi typically utilizes a ring buffer of a type known in the art. The tape drive has a buffer memory which is divided and allocated to each segment and is referred to as a ring buffer because data is stored in the buffer from a starting point to an end point, and when more data needs to be stored, the starting point is again utilized (possibly overwriting data already stored therein). A tape drive reads/writes the data from/to magnetic tape media in units referred to as ‘data sets’ and stores each data set into each segment. Segments are filled from top to bottom and back to top, repeatedly.
Each data set is encoded using interleaved sets of codewords that are organized into an ECC-encoded matrix of size M bytes×N bytes (M×N) and then written to tape as shown in FIG. 1, according to the prior art. There are two levels of encoding within this matrix 150. The first level of encoding utilizes the matrix rows 102. Each row 102 of the matrix contains C1-ECC row parity 106, which adds p-bytes of C1-ECC to the n-bytes of user data (e.g., N=n+p bytes). The second level of encoding, C2-ECC column parity 108, adds q-bytes of C2-ECC to each matrix column 104. For example, if q=12, then adding 12 bytes of C2-ECC would add 12 rows to the matrix 150 (e.g., M=m+q bytes).
However, many temporary errors may occur during reading of data from the tape media. One such condition is called a “temp burst” (comprising a plurality of temporary errors within a predetermined distance on the magnetic tape). Under a temp burst condition, a tape drive may not be able to correct all errors encountered while reading the data from the tape in a predetermined amount of time, and reports these errors as one or more permanent errors. For example, when the data set is read from the tape in a high error rate condition, C1/C2 ECC is not capable of correcting the read data. For example, in some approaches, C1-encoding is capable of correcting 10 bytes of error, and C2-encoding is capable of correcting 20 bytes of error. If the error bytes exceed this correction power, then data cannot be read from the tape. In this scenario, the tape drive will then attempt ERP to read the data set from the tape again with a different hardware setting (e.g., changing the tape speed). ERP repeats until C1/C2-encoding is able to correct the data or until the ERP retry count exceeds a threshold. If the retry count exceeds the threshold, then the tape drive will report a permanent error for the read operation.
To solve this issue, C/P ERP Multi has been used in tape drives. The C/P ERP Multi improves performance under a temp burst condition; however, the procedure utilizes a portion of the reserved buffer area. The procedure divides the ring buffer into two portions and uses one of these portions for storing data during the C/P ERP Multi procedure. The other portion of the ring buffer remains accessible by the tape drive for normal operation (reading/writing). As a result, the normal or typical ring buffer size is reduced and the ordinary streaming read performance (read performance that is possible when no burst error occurs) is degraded.
The two methods of C/P ERP (single cut/paste or multi-cut/paste) are available to conventional tape drives and must be selected by the tape drive before reading data. The drive must examine dynamic recovery performance criteria to determine which technique, C/P ERP Multi or C/P Single, will be the more effective choice. In configuring the drive for C/P ERP Multi operation, the drive may choose a buffer segmentation ratio based on dynamic performance criteria.